package com.zhongan.tb;

/**
 * С���Ա
 *
 * @author za-zhubin002
 */
public class TBMember {

    /**
     * ��Ա���
     */
    private int id;

    /**
     * ��Ա����
     */
    private String name;

    /**
     * ��̯����
     */
    private Double fee;

    /**
     * �������
     */
    private int orderNumber;

    /**
     * ��ע
     */
    private String remark;

    /**
     * �Ƿ�������� 1--��Ҫ�� 0--����Ҫ
     */
    private int needSort;

    /**
     * �Ƿ���Ҫ֧������ 1--��Ҫ��0--����Ҫ
     */
    private int needPay;

    /**
     * �����������
     */
    private int sortTime = 0;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getFee() {
        return fee;
    }

    public void setFee(Double fee) {
        this.fee = fee;
    }

    public int getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(int orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getNeedSort() {
        return needSort;
    }

    public void setNeedSort(int needSort) {
        this.needSort = needSort;
    }

    public int getNeedPay() {
        return needPay;
    }

    public void setNeedPay(int needPay) {
        this.needPay = needPay;
    }

    public int getSortTime() {
        return sortTime;
    }

    public void setSortTime(int sortTime) {
        this.sortTime = sortTime;
    }

    /**
     * �ַ�����Ա��Ϣת��Ϊ�Ŷӳ�Ա����
     *
     * @param str       ��ʽΪ�� id|name|fee|orderNumber|remark|needSort|needPay�� �ĳ�Ա��Ϣ
     * @param delimiter �ָ���
     */
    public void convertStrToMember(String str, String delimiter) {
        if (null == delimiter || delimiter.isEmpty())
            delimiter = "\\|";
        if (null == str || str.isEmpty())
            return;
        try {
            String[] memberInfo = str.split(delimiter);
            this.setId(Integer.parseInt(memberInfo[0]));
            this.setName(memberInfo[1]);
            this.setFee(Double.valueOf(memberInfo[2]));
            this.setOrderNumber(Integer.parseInt(memberInfo[3]));
            this.setRemark(memberInfo[4]);
            this.setNeedSort(Integer.parseInt(memberInfo[5]));
            this.setNeedPay(Integer.parseInt(memberInfo[6]));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
